$.ajax({
    url: '../server/scenics.php',
    data: {
        pid: 2
    },
    dataType: "json",
    success(res) {
        var {
            data: phone1
        } = res;
        show(phone1, ".phone1 .morephone")
    }
})

$.ajax({
    url: '../server/scenics.php',
    data: {
        pid: 13
    },
    dataType: "json",
    success(res) {
        var {
            data: phone2
        } = res;
        show(phone2, '.phone2 .morephone')
    }
})
//轮播图
var swiper = new Swiper(".mySwiper", {
    spaceBetween: 30,
    effect: "fade",
    setWrapperSize: true,
    loop: true,
    autoplay: {
        delay: 3000, // 自动轮播切换的间隔时间
        pauseOnMouseEnter: true, // 鼠标移入停止轮播
        disableOnInteraction: false //鼠标移出继续轮播
    },
    navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
    },
    pagination: {
        el: ".swiper-pagination",
        clickable: true,
    },
});
//回顶部
var top2 = document.querySelector('#top2');
var goLength;
var timer;
window.onscroll = function () {
    goLength = document.documentElement.scrollTop;
    if (goLength >= 800) {
        top2.style.display = 'block';
    } else {
        top2.style.display = 'none';
        if (goLength == 0) {
            clearInterval(timer)
        }
    }
}
top2.onclick = function () {
    clearInterval(timer)
    timer = setInterval(function () {
        document.documentElement.scrollTop = goLength - 30;
    }, 10)
}